package com.lvyou.ctrls;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
//↓接受请求 获取参数，校验，响应 除上述三项其他都有service 处理
@Controller
public class RegCtrl {

    @RequestMapping("/reg")
    public ModelAndView reg(String phone, String password){
        ModelAndView mv=new ModelAndView();
        if(phone==null || "".equals(phone)){
            mv.setViewName("redirect:/regFails.jsp?error=1");
            return mv;
        }
        if(password==null || "".equals(password)){

            mv.setViewName("redirect:/regFails.jsp?error=2");
            return mv;
        }
        mv.setViewName("index");
        return mv;
    }



}
